package nc.bs.pub.action;

import nc.bs.common.projectFAUtils;
import nc.bs.framework.common.NCLocator;
import nc.bs.pub.compiler.AbstractCompiler2;
import nc.itf.pu.m25.IInvoiceMaintain;
import nc.vo.pu.m25.entity.InvoiceVO;
import nc.vo.pu.m25.env.InvoiceUIToBSEnv;
import nc.vo.pu.m25.pub.InvoiceEnvExtractUtil;
import nc.vo.pub.BusinessException;
import nc.vo.pub.compiler.PfParameterVO;
import nc.vo.uap.pf.PFBusinessException;

public class N_25_DISCARD extends AbstractCompiler2 {
	public Object runComClass(PfParameterVO paraVo) throws BusinessException {
		try {
			super.m_tmpVo = paraVo;
			Object retValue = null;
			InvoiceVO[] vos = (InvoiceVO[]) ((InvoiceVO[]) this.getVos());
			InvoiceUIToBSEnv[] envs = InvoiceEnvExtractUtil.getEnvs(paraVo);
			
			//lhw 231128 保存前校验项目 begin
			new projectFAUtils().projectDataApprove("po_invoice", vos, "delete");
			//end
			
			IInvoiceMaintain service = (IInvoiceMaintain) NCLocator.getInstance().lookup(IInvoiceMaintain.class);
			service.delete(vos, envs);
			return retValue;
		} catch (Exception var6) {
			if (var6 instanceof BusinessException) {
				throw (BusinessException) var6;
			} else {
				throw new PFBusinessException(var6.getMessage(), var6);
			}
		}
	}
}